package com.eupmt.lab3.domain;

import com.eupmt.lab3.domain.ibator.IbatorUsuari;
import static com.eupmt.lab3.utils.Constants.*;

public class Usuari extends IbatorUsuari {

    //Atributs

    //Constructors
    public Usuari() {
      super();
      setIdusuari(UNDEFINED);
    }

    //Overrides
    @Override
    public boolean equals(Object o) {
        return (o != null) && (o instanceof Usuari) &&(getLogin().equals(((Usuari)o).getLogin()))
                                                    &&(getPassword().equals(((Usuari)o).getPassword()));
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 79 * hash + (this.getLogin() != null ? this.getLogin().hashCode() : 0);
        hash = 79 * hash + (this.getPassword() != null ? this.getPassword().hashCode() : 0);
        return hash;
    }


    @Override
    public String toString() {
        String str = "Usuari.\n";
        str += "login:" + getLogin() + "\n";
        str += "password:" + getPassword() + "\n";
        return str;
    }
}